#include <vector>
#include <string>
#include "tools/Fan.hpp"

using namespace std;


int main(int argc, char* argv[], char* envp[])
{
  vector<string> args;
  for (int i = 1; i < argc; i++)
    args.push_back(argv[i]);

  vector<pair<string, string> > env;
  for (int i = 0; envp[i] != NULL; i++)
  {
    string var = envp[i];
    size_t pos = var.find('=');
    if (pos != string::npos)
    {
      string varName = var.substr(0, pos);
      string varValue = var.substr(pos + 1);
      env.push_back(make_pair(varName, varValue));
    }
  }

  return Fan(env).run(args);
}
